org.eclipse.vtp.desktop.core.actions.util
Class InternalActionSetSection

java.lang.Object
  extended by org.eclipse.vtp.desktop.core.actions.util.InternalActionSetSection
All Implemented Interfaces:
InternalActionItemContainer

public class InternalActionSetSection
extends java.lang.Object
implements InternalActionItemContainer

This is a concrete implementation of IternalActionContainer that represents a set of action items to be grouped together with a separator in the menu.

Version:
2.0
Author:
Trip Gilman

Constructor Summary
InternalActionSetSection(java.lang.String containerId, java.lang.String name, SectionConstraint location)
          Creates a new InternalActionSetSection with the given container id, name, and location constraint.
 
Method Summary
 boolean addActionItem(InternalActionItem actionItem)
          Adds the given action item to the list of items contained in this sub-menu.
 void fillContextMenu(org.eclipse.jface.action.IMenuManager menuManager)
          Adds this containers actions and child containers to the given menu manager.
 InternalActionItemContainer findContainer(java.util.Stack ids)
          Locates the container with the given set of ids.
 java.lang.String getContainerId()
           
 SectionConstraint getLocation()
           
 java.lang.String getName()
           
 void processSelectionChange(IProvisioningModelSelection selection)
          Notifies the section the user selection has changed.
 void setSorter(IProvisioningActionItemSorter sorter)
          Assigns the given sorter to this action set section.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalActionSetSection

public InternalActionSetSection(java.lang.String containerId,
                                java.lang.String name,
                                SectionConstraint location)
Creates a new InternalActionSetSection with the given container id, name, and location constraint.

Parameters:
containerId -
name -
location -
Method Detail

setSorter

public void setSorter(IProvisioningActionItemSorter sorter)
Assigns the given sorter to this action set section. The sorter is used to organize the actions this section contains.

Parameters:
sorter - The new section sorter

addActionItem

public boolean addActionItem(InternalActionItem actionItem)
Description copied from interface: InternalActionItemContainer
Adds the given action item to the list of items contained in this sub-menu.

Specified by:
addActionItem in interface InternalActionItemContainer
Parameters:
actionItem - The item to add.
Returns:
true if the action was added, false if another action with the same name is already contained

findContainer

public InternalActionItemContainer findContainer(java.util.Stack ids)
Description copied from interface: InternalActionItemContainer
Locates the container with the given set of ids. The ids are listed in parent first order. If the current id matches this container, the id is removed and the next id is matched against it's children. If a matching child is found the remaining ids are passed to the child container's implementation of this function.

Specified by:
findContainer in interface InternalActionItemContainer
Parameters:
ids - A Stack of id strings
Returns:
The container with the given id and heritage

getContainerId

public java.lang.String getContainerId()
Returns:
the containerId.

getName

public java.lang.String getName()
Returns:
the name.

getLocation

public SectionConstraint getLocation()
Returns:
The current location constraint of this section

processSelectionChange

public void processSelectionChange(IProvisioningModelSelection selection)
Notifies the section the user selection has changed. This causes the visibility states of the items contained in this section to be recalculated.

Parameters:
selection - The new user selection

fillContextMenu

public void fillContextMenu(org.eclipse.jface.action.IMenuManager menuManager)
Description copied from interface: InternalActionItemContainer
Adds this containers actions and child containers to the given menu manager. All enabled and disable actions are added. Any action with the absent state are skipped.

Specified by:
fillContextMenu in interface InternalActionItemContainer